package jvm;

import java.util.HashMap;
import java.util.Map;

/**
 * 匿名内部类
 */
public class Demo {

    public Demo() {
        System.out.println("Constructor called：构造器被调用");
    }
    static {
        System.out.println("Static block called：静态块被调用");
    }
    {
        System.out.println("Instance initializer called：实例初始化块被调用");
    }


    public static void main(String[] args) {


        new Demo();
        Map map = new HashMap(){
            {

                System.out.println("我在哪里");
            }

        };


        try {
            System.out.println("try");
            throw new RuntimeException();
        } catch (Exception e) {
            System.out.println("Exception");
            return;
        } finally {
            System.out.println("finally");
        }


    }


    public class InnerDemo {

    }
}
